- Xcode - Install from App Store
src/
├── Components/*
├── Models/* (Data Models for frontend goes here)
├── Views/* (Views that the user will interact with)
├── ViewModels/* (Business Logic pertaining to Views)
├── Services/* (Logic related to external communication like API calls)
└── ALUMApp.swift (Entry-point for the app)
Once Xcode is installed, double-click ALUM.xcodeproj to open the frontend in Xcode
To lint our frontend codebase, we have SwiftLint setup on the github workflow.
Often times, SwiftLint will show errors that can be fixed automatically. To fix those, you need to have swiftlint setup locally.
- Install SwiftLint by following the README at https://github.com/realm/SwiftLint (I used brew install but any should work).
- To run swiftlint, use:
swiftlint lint --strict
- To fix swiftlint errors, use:
swiftlint lint --strict --fix
- After running with fix, make sure to run lint again in case there are some errors that cannot be fixed automatically.
N/A
src/
└── app/* (Structure of this directory matches the built in router nextJS has)
└── (authorized)/* (Screens accessible only after user auth is done)
├── mentees (Mentee table will go here)
├── mentors (Mentor table will go here)
├── sessions (Sessions table goes here)
└── layout.tsx (shared layout by all pages in (authorized))
└── login (Login page goes here)
├── components (all shared components will go here)
├── icons (lot of images are svgs and changing svg is much easier in React format than svg format)
└── styles (CSS modules for all Pages go here)
To setup, cd admin-portal
and then do npm install.
To run, use npm run dev
Run lint using npm lint
Documentation - https://documenter.getpostman.com/view/18831621/2s93XsXm5B
Postman - Used to test API endpoints manually.
We have a Postman collection setup for all our routes.
- Just click on this button and either "Fork Collection" (recommended) OR "View collection".
-
Next, setup the variable environment using the video tutorial linked - https://drive.google.com/file/d/1y1TsyelzPby0q7eyMPXuYSbsWRod6NdQ/view?usp=share_link Note: The
ALUM.postman_environment.json
imported in the video can be found in the root of the repository -
At this point, you should be able to run the requests on the collection (ones protected by auth too)
To get started, open a terminal and cd into the backend/
directory using
cd backend
Install all backend dependencies using
npm install
Place .env
file inside the backend/
directory.
You can find the .env
file in our slack channel.
Now, you are all set to start backend development. Open up VSCode and get started!
Following command runs the server at localhost:3000
npm run dev
By running this, you will be able to see any routes you create.
Code styling goes a long way towards writing readable code. Our PR's enforce code styling using lint checkers.
To run the lint tests locally, use:
npm run lint-check
Some lint errors can be automatically fixed. To do so, run:
npm run lint-fix
If your PR is failing lint check, use these commands!
src/
├── models/* (DB models to interact with the database)
├── services/* (Methods that utilizes models to perform operations on DB. Logic of the backend )
├── routes/* (Exposes the various services to the clients using endpoints)
└── app.ts (Main script to run the server and use routes)
The backend uses the firebase authentication and custom user claims to protect routes. Custom user claims are essentially roles and we use three: mentor, mentee, and admin. Outside of protecting the routes, the auth layer can also be used to determine who is accessing the route (mentor, mentee, admin, etc.). Reference the Firebase API for more information on how the auth layer works.
MongoDB Collection: dev Firebase: https://console.firebase.google.com/u/0/project/alum-dev-72d4f/overview Server: Not deployed. Run backend server locally on laptop. Note - Use the IP Address of wifi in APIConfig instead of localhost if application is running on your personal phone and not simulator Environment Files
- "backend/.dev.env". Backend Environment File found in google drive (ALUM > Development > Secrets)
- "ALUM/ALUM/GoogleService-Info-Dev.plist". Frontend Environment File found in google drive (ALUM > Development > Secrets)
MongoDB Collection: prod Firebase: https://console.firebase.google.com/u/0/project/alum-mobile-app/overview Server: Deployed at https://firebaseapp-ozybc5bsma-uc.a.run.app Environment Files
- "backend/.env". Backend Environment File found in google drive (ALUM > Development > Secrets)
- "ALUM/ALUM/GoogleService-Info-Prod.plist". Frontend Environment File found in google drive (ALUM > Development > Secrets)
Ensure all environment files are placed at their respective paths. All files can be found in our ALUM google drive at ALUM > Development > Secrets
We use the firebase to host our backend. Firebase has a feature called Cloud Functions which basically runs our server to process requests whenever one is received. This required Firebase Blaze Plan which is a "pay as you go". Judging from the scope of this, we should always be able to be under the free tier.
Before you deploy, you should login into firebase using firebase CLI by running the following commands. Note - You only need to do this once
npm i -g firebase-tools
firebase login
To deploy backend, simply run the following command
npm run deploy
Before deploying you can test out the server by simulating the deployment using
npm run local-deploy
This runs your server locally.
All app releases are done through the Apple Connect Portal.
When you "Archive" a build it will create the build in prod environment so the prod backend server will be used. When you simply hit the run button, i.e. regular development build the dev environment is selected.
Note - Checkout this comment for more info on how the prod and dev environments are set in xcode.
Till now we have only released testflight. You can checkout this tutorial on how to release a test flight - video