The Architecture
As we are developing a web application, we will be using the following tech stack:
- Next.js (framework for React)
- React
- Django (Python backend)
- TypeScript
- Python
- Mantine React Components library
- Tailwind CSS
- Visual Studio Code
The Workflow
We will be using Next.js as our React framework to develop our web application. For now, the entirety of our web application will be running on one local server. We are using a Node backend (TypeScript) in which our frontend is built with React components. In the future, it is anticipated that a significant portion of our backend will need to be developed in Python in order to handle the SMS feature of our application. Therefore, our Python backend will exist in a separate server (via Django) which will communicate with our main web application server via HTTP requests. This will require exposing API endpoints for our Python backend.
Getting Started
If this is the first time you are pulling from the repo, open a new command line and run npm install
(make sure you install Node.js
and the npm
package manager first if you don't have this on your system).
To start up the server, run npm run dev
.
As per the instructions from the terminal, navigate to http://localhost:3000/
.
Once the server is online, you can keep modifying the application/pages directly and just save the files to see the changes reflected in real-time. To shut down the development server, simply delete your terminal.
About Next.js
Next.js is a React framework that adds additional functionality on top of what React already has to offer. Its main selling point is server-side rendering. During the development process, we will be running the development server to work on our web application. This is recommended for development. However, once our project is completed, we will build the pages for our application using npm build
to demo our application in production mode.
The Project Structure
The main sections we will be working from are the app
and components
directory. SInce we are using React, all of our components will exist in our components
directory and will be imported into the respective pages within the app
directory. The layout.tsx
file is just a general layout file that has already been set up and does not need to be modified until further notice. For example, the page.tsx
file is what you currently see when you launch the application.
Python Backend
Django
To start the Python backend server, run py manage.py runserver
. In case you need the port, you can add the port after runserver such as py manage.py runserver 8080