Skip to content

Commit

Permalink
Merge pull request #1 from AnakUtara/feat/admin-dashboard/riady
Browse files Browse the repository at this point in the history
Feat/admin dashboard/riady
  • Loading branch information
jordansmrd authored Jul 22, 2024
2 parents a241a0a + 62a112d commit c69f374
Show file tree
Hide file tree
Showing 190 changed files with 10,384 additions and 601 deletions.
9 changes: 8 additions & 1 deletion apps/api/.env.development
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
NODE_ENV=development
PORT=8000
DATABASE_URL="mysql://root@localhost:3306/mydb"
DATABASE_URL="mysql://root:D4nau$unter@localhost:3306/online_groceries"
CORS=http://localhost:3000
ACC_SECRET_KEY=finpro-akses
REFR_SECRET_KEY=finpro-refresh
FP_SECRET_KEY=finpro-forgot
VERIF_SECRET_KEY=finpro-verif

RAJAONGKIR_API_KEY='84d2023f491aa0b631bbf096b319d4a7'
38 changes: 32 additions & 6 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
"version": "1.0.0",
"description": "",
"main": "src/index.ts",
"prisma": {
"seed": "tsx prisma/seed.ts"
},
"scripts": {
"dev": "cross-env NODE_ENV=development ts-node-dev -r tsconfig-paths/register src/index.ts",
"dev": "cross-env NODE_ENV=development ts-node-dev -r tsconfig-paths/register --files src/index.ts",
"build": "tsc && tsc-alias",
"serve": "cross-env NODE_ENV=production node dist/index.js",
"test": "echo \"Error: no test specified\" && exit 1",
Expand All @@ -13,19 +16,42 @@
"author": "",
"license": "ISC",
"dependencies": {
"@prisma/client": "^5.7.1",
"@prisma/client": "^5.16.1",
"axios": "^1.7.2",
"bcrypt": "^5.1.1",
"cors": "^2.8.5",
"cross-env": "^7.0.3",
"date-fns": "^3.6.0",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"express": "^4.19.2",
"fs": "^0.0.1-security",
"jsonwebtoken": "^9.0.2",
"multer": "^1.4.5-lts.1",
"mustache": "^4.2.0",
"nanoid": "^5.0.7",
"node-cron": "^3.0.3",
"nodemailer": "^6.9.13",
"nodemon": "^3.1.4",
"sharp": "^0.33.4",
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0",
"typescript": "^5.3.3"
"typescript": "^5.5.3",
"voucher-code-generator": "^1.3.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@types/bcrypt": "^5.0.2",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"prisma": "^5.7.1",
"tsconfig-paths": "^4.2.0"
"@types/jsonwebtoken": "^9.0.6",
"@types/multer": "^1.4.11",
"@types/mustache": "^4.2.5",
"@types/node": "^20.14.9",
"@types/node-cron": "^3.0.11",
"@types/nodemailer": "^6.4.15",
"@types/voucher-code-generator": "^1.1.3",
"prisma": "^5.16.1",
"tsconfig-paths": "^4.2.0",
"tsx": "^4.16.2"
}
}
Empty file added apps/api/prisma/data/address.ts
Empty file.
16 changes: 16 additions & 0 deletions apps/api/prisma/data/categories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Prisma } from '@prisma/client';

export const categories: Prisma.CategoryCreateManyInput[] = [
{ id: 1, name: 'Sayur', created_at: new Date(), updated_at: new Date() },
{ id: 2, name: 'Buah', created_at: new Date(), updated_at: new Date() },
{ id: 3, name: 'Protein', created_at: new Date(), updated_at: new Date() },
{ id: 4, name: 'Sayur', created_at: new Date(), updated_at: new Date() },
{ id: 5, name: 'Sembako', created_at: new Date(), updated_at: new Date() },
{ id: 6, name: 'Siap Saji', created_at: new Date(), updated_at: new Date() },
{
id: 7,
name: 'Susu & Olahan',
created_at: new Date(),
updated_at: new Date(),
},
];
15 changes: 15 additions & 0 deletions apps/api/prisma/data/cities.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import axios from 'axios';

export async function copyCities() {
const res = await axios.get('https://api.rajaongkir.com/starter/city', {
headers: {
key: process.env.RAJAONGKIR_API_KEY,
},
});
const {
data: {
rajaongkir: { results },
},
} = res;
return results;
}
1 change: 1 addition & 0 deletions apps/api/prisma/data/images.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const images = [];
Binary file added apps/api/prisma/data/images/categories.zip
Binary file not shown.
Binary file added apps/api/prisma/data/images/categories/Buah.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added apps/api/prisma/data/images/categories/Protein.webp
Binary file not shown.
Binary file added apps/api/prisma/data/images/categories/Sayur.webp
Binary file not shown.
Binary file added apps/api/prisma/data/images/categories/Sembako.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions apps/api/prisma/data/products.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const products = [];
28 changes: 28 additions & 0 deletions apps/api/prisma/data/schedule.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { StoreSchedule } from '@prisma/client';

export const schedule: StoreSchedule[] = [
{
id: 'cly5uxlq100020cl5giq7e62r',
name: 'Operational',
start_time: new Date(2024, 3, 7, 9, 0, 0),
end_time: new Date(2024, 3, 7, 18, 0, 0),
created_at: new Date(),
updated_at: new Date(),
},
{
id: 'cly5uwfce00010cl59ze5fnh1',
name: 'Setengah hari',
start_time: new Date(2024, 3, 7, 9, 0, 0),
end_time: new Date(2024, 3, 7, 15, 0, 0),
created_at: new Date(),
updated_at: new Date(),
},
{
id: 'cly5uv68000000cl5ggdf1crx',
name: 'Libur nasional',
start_time: null,
end_time: null,
created_at: new Date(),
updated_at: new Date(),
},
];
81 changes: 81 additions & 0 deletions apps/api/prisma/data/users.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { hashPassword } from '@/libs/bcrypt';
import { Gender, Role, User } from '@prisma/client';

export const users: User[] = [
{
id: 'cly5vk76k00000dmg78mgfo4y',
email: '[email protected]',
password: '$2a$12$ONRX/7qOG1nqV8XU7WrLQ.PO11Htfo5Y0aKaWfaEJh.xGmlPGpPwm',
reset_token: null,
is_verified: true,
role: Role.super_admin,
full_name: 'Rama Naufal Alim',
gender: Gender.male,
dob: null,
phone_no: null,
store_id: null,
created_at: new Date(),
updated_at: new Date(),
avatar_id: null,
voucher_id: null,
referral_code: null,
reference_code: null,
},
{
id: 'cly5vx4zh00000cju1d1ig61c',
email: '[email protected]',
password: '$2a$12$I/3WZPa1bq3ETdiFOihsjeuZQlIzRYDUJrZHyJkq7nLUEhFHum1Bi',
reset_token: null,
is_verified: true,
role: Role.store_admin,
full_name: 'Be Liau',
gender: Gender.male,
dob: null,
phone_no: null,
store_id: null,
created_at: new Date(),
updated_at: new Date(),
avatar_id: null,
voucher_id: null,
referral_code: null,
reference_code: null,
},
{
id: 'cly5vyacc00010cju7mdgd60n',
email: '[email protected]',
password: '$2a$12$kRSKn8F2mQ4K/x.DolwzTOZxYKzdBJYvw31C0FqNCLFg/KBLqKvay',
reset_token: null,
is_verified: false,
role: Role.customer,
full_name: 'An Drew',
gender: Gender.male,
dob: null,
phone_no: null,
store_id: null,
created_at: new Date(),
updated_at: new Date(),
avatar_id: null,
voucher_id: null,
referral_code: null,
reference_code: null,
},
{
id: 'cly5w0lzg00020cjugmwqa7zf',
email: '[email protected]',
password: '$2a$12$J0/YV0ZnTXyvj3Ql5J3koeCErpJWKifyZHuYA2idDUm8m9kC5DU32',
reset_token: null,
is_verified: true,
role: Role.customer,
full_name: 'Frangky Sihombing',
gender: Gender.male,
dob: null,
phone_no: null,
store_id: null,
created_at: new Date(),
updated_at: new Date(),
avatar_id: null,
voucher_id: null,
referral_code: 'AzaGE',
reference_code: null,
},
];
1 change: 1 addition & 0 deletions apps/api/prisma/data/variants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const variants = [];
Loading

0 comments on commit c69f374

Please sign in to comment.