An online marketplace for students to sell their used-goods to fellow students at a competitive price point. Made with Vue + Django.
- Anaconda or Miniconda => For setting up python and javascript virtual environment (You can run node inside the conda environment)
- PostgreSQL => or any other SQL database (make changes in settings.py)
conda create -n <env-name> python=3.11.5
conda activate <env-name>
pip install -r requirements.txt
conda install nodejs
cd frontend
npm install
cd ..
.
├── .vscode
├── apis
├── campusSwap
├── frontend
├── products
├── .
├── . (random folders that might be added to the repo in the future)
├── .
├── .gitignore
├── manage.py
├── README.md
├── requirements.txt
└── .env
3.2. Go to ImgBB's website to get your api key (will take ~2 minutes)
3.3. Go to Razorpay's website to get an rzp_secret and rzp_id (will take ~10 minutes):
RZP_SECRET=<your_rzp_secret>
RZP_ID=<your_rzp_id>
API_KEY=<your-imgbb-api-key>
In case you want to store anything secret, this is the place
CREATE DATABASE campusswap;
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "campusswap",
"USER": "postgres", #don't change this(unless you know what you are doing)
"PASSWORD": "YOUR_PASSWORD_HERE",
"HOST": "localhost",
"PORT": "5432"
}
}
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser --username 1234
(make sure username is numerical, i.e just copy the command above as it is) Then fill out all the fields as you are prompted
python manage.py shell
from django.contrib.auth.models import User
user = User.objects.get(username = 1234)
user.first_name = "John"
user.last_name = "Doe"
user.save()
\c campusswap;
INSERT INTO college_students ("moodleID", first_name, last_name, email)
VALUES
(1, 'John', 'Doe', '[email protected]'),
(2, 'Jane', 'Smith', '[email protected]'),
(3, 'Steve', 'Digg', '[email protected]');
You are only allowed to use these three accounts to register(not login, yes, register)
python manage.py runserver
cd frontend
npm run dev
npm run build
python manage.py makemigrations <app_name>
npm i vite