Currently, our team consists of mostly student developers, and we are running on a 0 budget. Maintaining the Sambal SOS App involves financial costs, hence we are opening up to the public for volunteering or contributions.
This Project is completely Open Source and we welcome all efforts to help the app grow and develop
- Monorepo
- Frontend
- Prerequisites
- How To Get Google Auth Keys
- How To Install the App
- Project Structure
- Backend
- Prerequisites
- How To Install the App
- Project Structure
- Tech Stack
- Protocols
- Pull Request Template
- Branches
A while back, we migrated separate repositories into a monorepo to streamline collaboration and CI/CD processes. The monorepo is managed by Lerna, housing two packages: the webapp and the server. The webapp is deployed onto Vercel, while the server lives on GCP App Engine. The database lives on a Digital Ocean droplet; it was originally on GCP Cloud SQL, but was moved to a droplet after rising maintenance costs.
This app uses multiple APIs and has a list of env variables needed to start the app
follow the .env template to setup your own
if you don't have the variables some parts of the app will not work
this corresponds to REACT_APP_GOOGLE_AUTH_CLIENT_ID
in the .env files
-
Create an account in https://console.developers.google.com
-
Click on Create Credentials and Choose the OAuth Client ID option
after this you should be provided with a prompt that lets you copy the client id, paste it in the .env file and you are good to go
-
Clone the project
$ gh repo clone sidharrth2002/sambal-sos-app
-
Install Dependencies
$ npm install
-
Start the Development Server
$ npm start
the script will bring you to your default browser, wait for the development server to fully start and you are ready to go
Directory | Description |
---|---|
/public | Stores static files and images |
/src | Stores main content of project |
src
- /api-> endpoint to get geolocation data
- /app -> handles state in the app (redux)
- /assets -> static assets
- /components -> organize components
- /constants -> stores configurations and constants
- /features -> currently contains the auth slice (handles authentication and state of auth)
- /screens handles each page of the app
- *Auth* -> login & signup page
- *Foodbanks* -> contains a static list of food banks and the respective page
- *Home* -> contains the main page of the app (with the google maps component)
- *PrivacyPolicy* -> self explanatory
- *ReportForm* -> form page to report or request SOS
- /style -> stores the styling of the appp
- /translations -> contains i18n translation files
- /utils -> extra functions to help with the app
have postgresql installed here
-
start a session by doing
$ psql postgres
in your terminal -
when you see
postgres=#
, type in
CREATE DATABASE benderaputih;
- login to the db
\c benderaputih
- Create postgis extension
- make sure that postgis is installed on your computer while being connected to the db, paste in this line of code and run it
CREATE EXTENSION postgis;
- clone the repo
- run
npm install
- create
.env
file as given in env example - enter your database configs in
.env
at least for development in local. - run
npx sequelize db:create
It will create database for you. - run
npx sequelize db:migrate
It will create tables. - run
npm run dev
Folder | Description |
---|---|
/config | stores configurations for sequelize (don't touch this) |
/db | stores sequelize migrations and seeders (provide test data) |
/logs | stores logs of errors and messages |
/src | contains the main content -> models, controllers and routes |
/utils | contains extra functions |
- Server with Express.js
- Database schema and models using Sequelize ORM.
- User authentication with JWT.
- StandardJs for coding standards and styling.
- Request validation using Express-validator.
- Morgan and Winston for server side logging.
- Swagger for API documentation.
Please Follow these suggestions to make sure that the repo is organized and other people who wish to contribute can have a nice time doing so
If you wish to be on the main team and actively contribute, we would recommend that you join our discord server
Otherwise you can:
- Open an issue about something
- Comment on Issues and Pull Requests
- Participate in issue threads
- Make Bug Reports
- Make your own pull requests to solve open issues
What type of change did you make?
feat (add something new) or fix (fix an issue) or refactor (no changes to features, e.g. removing comments, logs)
Describe the changes:
1.
2.
3.
Add screenshots:
[] Does your change break anything?
Mention someone for review
@someone
main -> development branch, fork or clone from this branch
production -> deployed to vercel, don't touch this