Skip to content

Commit

Permalink
rfac: project file structure seperated for backend and frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
yp969803 committed Apr 18, 2024
1 parent 5ccc649 commit 322c421
Show file tree
Hide file tree
Showing 212 changed files with 202 additions and 206 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: CI Workflow
on:
pull_request:
branches: [ masterm main ]
branches: [ master, main ]
paths:
- 'src/**'
- 'backend/src/**'
push:
branches: [master, main]
paths:
- 'src/**'
- 'backend/src/**'
jobs:
build:
runs-on: ubuntu-latest
Expand Down
80 changes: 2 additions & 78 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,64 +1,11 @@
HELP.md

target

.m2

bin

!.mvn/wrapper/maven-wrapper.jar

!**/src/main/**/target/

!**/src/test/**/target/

**.jpeg
**.png
**.jpg
### STS ###

.apt_generated

.classpath

.factorypath

.project

.settings

.springBeans

.sts4-cache

### IntelliJ IDEA ###

.idea

- .iws
- .iml
- .ipr

### NetBeans ###

/nbproject/private/

/nbbuild/

/dist/

/nbdist/

/.nb-gradle/

build/

!**/src/main/**/build/

!**/src/test/**/build/

### VS Code ###

.idea/
.vscode/

# keys
Expand All @@ -69,27 +16,4 @@ postgres
files


# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.env

npm-debug.log*
yarn-debug.log*
yarn-error.log*
target
8 changes: 2 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ npm ci

```
source env.sh
cd frontend
npm start
```

### Run backend

```
source env.sh
cd backend
mvn spring-boot:run -DskipTests
```

Expand Down Expand Up @@ -111,12 +113,6 @@ chor: Chnge project colour (frontend)
rfac: Get UserApi (backend)
```

## File Structure

- **src/main:** Contains all the backend code
- **src/test:** Contains all the tests
- **src/frontend:** Contains all the frontend code

## Backend API'S

API's for testing purpose can be found in [thunder-client-collection](thunder-collection_Tracer.json)
19 changes: 0 additions & 19 deletions .dockerignore → backend/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,3 @@ build/

# Maven
.m2/

# Postgresql Data
.postgresql_data/
postgres
files

docker-compose.yaml
Dockerfile
README.md
run.sh
build
.github
node_modules
.eslintignore
.eslintrc.json
.prettierignore
.prettierrc
package-lock.json

62 changes: 62 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
HELP.md

target

.m2

bin

!.mvn/wrapper/maven-wrapper.jar

!**/src/main/**/target/

!**/src/test/**/target/

**.jpeg
**.png
**.jpg
### STS ###

.apt_generated

.classpath

.factorypath

.project

.settings

.springBeans

.sts4-cache

### IntelliJ IDEA ###

.idea

- .iws
- .iml
- .ipr

### NetBeans ###

/nbproject/private/

/nbbuild/

/dist/

/nbdist/

/.nb-gradle/

build/

!**/src/main/**/build/

!**/src/test/**/build/

### VS Code ###

.vscode/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pom.xml → backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<artifactId>activityleaderboard</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>activityleaderboard</name>
<description>Spring boot backend for activity-leaderboard</description>
<description>Spring boot backend for tracer</description>

<!-- Project properties to set versions for plugins and dependencies -->
<properties>
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
"
backend:
build:
context: .
context: ./backend
dockerfile: Dockerfile.backend
container_name: tracer-backend
networks:
Expand All @@ -48,7 +48,7 @@ services:

frontend:
build:
context: .
context: ./frontend
dockerfile: Dockerfile.frontend
container_name: tracer-frontend
network_mode: host
Expand Down
12 changes: 12 additions & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
docker-compose.yaml
Dockerfile
README.md
run.sh
build
.github
node_modules
.eslintignore
.eslintrc.json
.prettierignore
.prettierrc
package-lock.json
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.env

npm-debug.log*
yarn-debug.log*
yarn-error.log*
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/App.test.tsx → frontend/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from 'frontend/app';
import App from 'app';

test('renders learn react link', () => {
render(<App />);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useState } from 'react';
import TimeRangeSwitch from 'frontend/app/components/timeRangeSwitch';
import TimeRangeSwitch from 'app/components/timeRangeSwitch';

import './index.scss';
import { GetProject } from 'frontend/app/api/project';
import { GetProject } from 'app/api/project';
import { useNavigate } from 'react-router-dom';
interface Props {
weekly: boolean;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { useDispatch } from 'react-redux';
import { searchAction } from 'frontend/features/workspace/slices/projectSearchSlice';
import { searchAction } from 'features/workspace/slices/projectSearchSlice';
import search_icon from 'app/assets/images/search_icon.svg';
import './index.scss';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { timeRangeModel } from 'frontend/features/project/components/contributorCard/types';
import { timeRangeModel } from 'features/project/components/contributorCard/types';
import { weekAction, monthAction } from './timeRangeSlice';
import './index.scss';
import { clearConfigCache } from 'prettier';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createSlice } from '@reduxjs/toolkit';
import { TIMERANGE } from 'frontend/app/constants/sliceNames';
import { TIMERANGE } from 'app/constants/sliceNames';

export const timeRangeSlice = createSlice({
name: TIMERANGE,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UserOrgs } from 'frontend/app/api/user';
import { UserOrgs } from 'app/api/user';
import { createContext } from 'react';

export interface UserContextType {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FC, ReactNode, useState } from 'react';
import UserContext from './userContext';
import { UserOrgs } from 'frontend/app/api/user';
import { UserOrgs } from 'app/api/user';

interface Props {
children: ReactNode;
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/frontend/app/index.tsx → frontend/src/app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Navbar from 'frontend/app/components/navbar';
import BasicRoutes from 'frontend/app/routes/BasicRoutes';
import Navbar from 'app/components/navbar';
import BasicRoutes from 'app/routes/BasicRoutes';
import './index.scss';
import toast, { Toaster } from 'react-hot-toast';
import { getUser } from './api/user';
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@

import { Routes, Route } from 'react-router-dom';
import ProjectPage from 'frontend/features/project';
import AddProject from 'frontend/features/AddProject';
import Error from 'frontend/features/Error';
import WorkspaceView from 'frontend/features/workspace-view';
import Login from 'frontend/features/login';
import AddWorkspace from 'frontend/features/AddWorkspace';
import Workspace from 'frontend/features/workspace';
import ProjectPage from 'features/project';
import AddProject from 'features/AddProject';
import Error from 'features/Error';
import WorkspaceView from 'features/workspace-view';
import Login from 'features/login';
import AddWorkspace from 'features/AddWorkspace';
import Workspace from 'features/workspace';

import EditWorkspace from 'frontend/features/EditWorkspace';
import EditProject from 'frontend/features/EditProject';
import WorkspaceMembers from 'frontend/features/workspace-members ';
import WorkspaceAddMember from 'frontend/features/WorkspaceAddMember';
import ProjectMembers from 'frontend/features/project-members ';
import ProjectAddMember from 'frontend/features/ProjectAddMember ';
import EditWorkspace from 'features/EditWorkspace';
import EditProject from 'features/EditProject';
import WorkspaceMembers from 'features/workspace-members ';
import WorkspaceAddMember from 'features/WorkspaceAddMember';
import ProjectMembers from 'features/project-members ';
import ProjectAddMember from 'features/ProjectAddMember ';
import FirstVisit from '../components/firstVisit';

const BasicRoutes = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { combineReducers } from 'redux';
import { setAllUsernamesReducer, setUsernameReducer } from './usersReducers';
import timeRangeReducer from 'frontend/app/components/timeRangeSwitch/timeRangeSlice';
import searchReducer from 'frontend/features/workspace/slices/projectSearchSlice';
import timeRangeReducer from 'app/components/timeRangeSwitch/timeRangeSlice';
import searchReducer from 'features/workspace/slices/projectSearchSlice';
import { orgReducer } from './orgReducers';

export const reducers = combineReducers({
Expand Down
File renamed without changes.
Loading

0 comments on commit 322c421

Please sign in to comment.