Before you begin, ensure you have the following installed on your system:
Ensure you have environment variables set up for development by creating a
.env
file.
The project is divided into two main parts:
-
Frontend (located in the
frontend
directory):- Built using React Native + Expo.
- Cross-platform support for iOS, Android, and web.
-
Backend (located in the
backend
directory):- Built using Node.js + Express.
- MongoDB for database operations.
- Supabase for authentication.
git clone https://github.com/your-repo/snapper.git
cd snapper
We use Taskfile to streamline setting up the project.
task install
This command will install dependencies for both frontend and backend.
Create a .env in the root directory containing the following:
NODE_ENV=development
SERVER_PORT=3000
MONGO_URL=mongodb+srv://qwantumsnapper:I222Irhjv7XjJXpc@cluster0.2eorm.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0
MONGO_USERNAME="user"
MONGO_PASSWORD="dbUserPassword"
SUPABASE_PASSWORD="p4JeQ2sCH3OXC1jP"
SUPABASE_URL="https://npyvbmfnusakklalqxcz.supabase.co"
SUPABASE_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im5weXZibWZudXNha2tsYWxxeGN6Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MjkyODg2MTgsImV4cCI6MjA0NDg2NDYxOH0.P_gUi5uPuALkeXtHeWKYrPDVaIyESW5BQS_NvdvRkNs"
You can start the frontend and backend simultaneously by running:
docker compose up
task start
Or, you can start each service separately:
- Frontend (React Native):
task frontend:start
- Backend (Express):
task backend:start
For development, where you may want auto-reload features:
task backend:dev
To run the backend tests, use:
task backend:test
We use Jest for testing the backend.
Here’s an overview of the important backend routes:
Auth Routes: POST /auth/register: Register a new user.
POST /auth/login: Log in an existing user.
POST /auth/logout: Log out the user.
Healthcheck:
GET /ping: Check server status, requires authentication.
Please make sure to create a new branch for every feature you work on, and always create a pull request for code review. Ensure that all tests pass locally before submitting your PR.
EXPO_NO_KEYCHAIN=1 eas build -p ios --profile production --auto-submit
If you run into any problems, feel free to slack me!
Happy coding! 🐠