A unique, one-of-its-kind dashboard that opens up constituency-wise fiscal information for several centrally sponsored and central sector schemes.
.env.local
file in the root of directory.This project uses styled-components to handle all of the stylings. It provides lots of features to improve the developer experience.
Pages and most component styles are available in the same file, although some components have a separate file, e.g.: ButtonComp.ts.
To make the styling scalable, we use a theme.ts
file in the /config
directory. It contains all the colors and gradients from the Design System.
The project requires a CKAN URL to fetch datasets. You can save them in the .env.local
file in the following format. Read more about env.
We can also pass a Google Analytics Id in the same file
CKAN_URL = 'CKAN_URL/api/3/action';
NEXT_PUBLIC_GOOGLE_ANALYTICS = '';
/
/[state]
/explorer
/about
The component directory contains all the components required to build the platform. The components are categorized depending on their purpose. You can read more about components.
Each directory contains an index.ts
file to manage Default Exports.
The project uses REST APIs provided by CKAN to access, filter, sort, and search datasets.
We can find data fetching functions at /utils/fetch.ts.
Read more in utils
When visiting a page, you may want to fetch the data on the server side. To do so, you can use getServerSideProps
function from NextJS:
import { GetServerSideProps } from 'next';
import { stateSchemeFetch } from 'utils/fetch';
...
export const getServerSideProps: GetServerSideProps = async (context) => {
export const getServerSideProps: GetServerSideProps = async () => {
const stateData = await stateSchemeFetch();
return {
props: {
stateData,
},
};
};
};
The project uses the ESLint config provided by Next.js, eslint-config-next. We can modify the rules on a project basis in the .eslintrc.js
file.
Install the dependencies:
npm i
Boot the demo frontend:
npm run dev
Open http://localhost:3000 to see the home page π
You can start editing the page by modifying /pages/index.tsx
. The page auto-updates as you edit the file.
For any new feature or bug reports, please request them in issues.
See CONTRIBUTING.md for ways to get started.
Please adhere to Code of Conduct.